package gui.typeEditors;

import java.awt.event.ActionListener;
import java.awt.event.FocusListener;

public class DoubleEditor extends NumberEditor<Double> implements ActionListener, FocusListener
	{
	private static final long serialVersionUID = -118453273518947945L;

	public DoubleEditor(double initialValue, double displayValueMultiplier, int columns, boolean permitGrowing)
		{
		super(initialValue, displayValueMultiplier, columns, permitGrowing);
		}
	
	public DoubleEditor(double initialValue, double outputMultiplier)
		{
		this(initialValue, outputMultiplier, DEFAULT_COLUMNS, true);
		}


	@Override
	public Double getValue()
		{
		return (Double)value;
		}

	@Override
	protected Double div(Double value, Double divisor)
		{
		return value/divisor;
		}

	@Override
	protected Double mul(Double value, Double factor)
		{
		return value*factor;
		}

	@Override
	protected Double parse(String text)
		{
		return Double.parseDouble(text);
		}
	}
